package com.itheima03.day16test;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

/**
 * @author 刘全
 * @date 2021/8/10
 */
public class ClientTest4 {
    public static void main(String[] args) throws IOException {
        /**
         * 4. 使用TCP完成简单的数据传输
         *     发送端发送，接收端接收
         */
        Socket s = new Socket("127.0.0.1",10086);

        OutputStream os = s.getOutputStream();
        Scanner sc = new Scanner(System.in);
        String ss = sc.nextLine();
        os.write(ss.getBytes());

        s.close();
    }
}
